package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.YongyouQtckMapper;
import com.ruoyi.quartz.domain.YongyouQtck;
import com.ruoyi.quartz.service.IYongyouQtckService;

/**
 * 其他出库Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-17
 */
@Service
public class YongyouQtckServiceImpl implements IYongyouQtckService 
{
    @Autowired
    private YongyouQtckMapper yongyouQtckMapper;

    /**
     * 查询其他出库
     * 
     * @param vouchdate 其他出库主键
     * @return 其他出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public YongyouQtck selectYongyouQtckByVouchdate(String vouchdate)
    {
        return yongyouQtckMapper.selectYongyouQtckByVouchdate(vouchdate);
    }

    /**
     * 查询其他出库列表
     * 
     * @param yongyouQtck 其他出库
     * @return 其他出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<YongyouQtck> selectYongyouQtckList(YongyouQtck yongyouQtck)
    {
        return yongyouQtckMapper.selectYongyouQtckList(yongyouQtck);
    }

    /**
     * 新增其他出库
     * 
     * @param yongyouQtck 其他出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertYongyouQtck(YongyouQtck yongyouQtck)
    {
        return yongyouQtckMapper.insertYongyouQtck(yongyouQtck);
    }

    /**
     * 修改其他出库
     * 
     * @param yongyouQtck 其他出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateYongyouQtck(YongyouQtck yongyouQtck)
    {
        return yongyouQtckMapper.updateYongyouQtck(yongyouQtck);
    }

    /**
     * 批量删除其他出库
     * 
     * @param vouchdates 需要删除的其他出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouQtckByVouchdates(String[] vouchdates)
    {
        return yongyouQtckMapper.deleteYongyouQtckByVouchdates(vouchdates);
    }

    /**
     * 删除其他出库信息
     * 
     * @param vouchdate 其他出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouQtckByVouchdate(String vouchdate)
    {
        return yongyouQtckMapper.deleteYongyouQtckByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouQtckByDate(String vouchdate)
    {
        return yongyouQtckMapper.deleteYongyouQtckByDate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearQtck(){
        return yongyouQtckMapper.clearQtck();
    }
}
